Estimating the Moisture Ratio Model of Cantaloupe Slices by Maximum Likelihood Principle-Based Algorithms

As an agricultural plant, the cantaloupe contains rich nutrition and high moisture content. In this paper, the estimation problem of the moisture ratio model during a cantaloupe microwave drying process was considered. First of all, an image processing-based cantaloupe drying system was designed and the expression of the moisture ratio with regard to the shrinkage was built. Secondly, a maximum likelihood principle-based iterative evolution (MLP-IE) algorithm was put forward to estimate the moisture ratio model. After that, aiming at enhancing the model fitting ability of the MLP-IE algorithm, a maximum likelihood principle-based improved iterative evolution (MLP-I-IE) algorithm was proposed by designing the improved mutation strategy, the improved scaling factor, and the improved crossover rate. Finally, the MLP-IE algorithm and MLP-I-IE algorithm were applied for estimating the moisture ratio model of cantaloupe slices. The results showed that both the MLP-IE algorithm and MLP-I-IE algorithm were effective and that the MLP-I-IE algorithm performed better than the MLP-IE algorithm in model estimation and validation.


Introduction
A cantaloupe (Cucumis melo var. saccharinus) is a kind of agricultural plant and belongs to Cucurbitaceae. Cantaloupes contain rich nutrition and are good sources of ζ-carotene and vitamin C. Furthermore, they have low unsaturated fat, low cholesterol, and high moisture contents [1][2][3][4]. China is the largest producer of cantaloupes with a production of 13.8 million tons in 2020 [5]. The rot of cantaloupes caused by untimely transportation and sales results in losses of up to 20-30% of total production [6]. Drying is a common method to effectively extend the shelf life of cantaloupes. In drying processes, the changes in the moisture contents always lead to changes in shapes which are expressed as shrinkage [7,8].
In the process of modeling drying processes, the moisture content and the shrinkage are two significant indicators [9,10]. In recent decades, the different mathematical models of moisture content and shrinkage during drying processes have been studied [11][12][13]. Yadollahinia et al. investigated the drying characteristics of potato slices and concluded that the dimensionless area changes of the potato slices decreased linearly as the dimensionless moisture content decreased [14]. During the drying process of pineapple slices, a linear function containing exponential constants was used to express the relationship between the shrinkage and the moisture content [15]. The models in [14,15] were the shrinkage versus the moisture content. Conversely, this paper constructed the mathematical model of the moisture ratio with regard to the shrinkage during the cantaloupe drying process as the n-order polynomial according to Weierstrass approximation theorem, and developed two new algorithms for model estimation.
The maximum likelihood principle is widely utilized in system modellng and parameter estimation for the reason that it has good statistical properties and it can be applied for both linear models and nonlinear models [16,17]. In order to obtain the estimated values, the maximum likelihood principle is to maximize the probability of the occurrence of the experimental data [18][19][20]. Based on the maximum likelihood principle, Wu et al. studied a method to jointly estimate the amplitude and noise variance of a single sinusoid [21]. Xie et al. used the maximum likelihood principle to reconstruct the parameters of Bernoulli autoregressive systems [22]. Çayır and Candan developed a parameter estimation approach for autoregressive models through using the maximum likelihood principle [23]. By using the maximum likelihood principle, this paper derived the maximum likelihood fitness and proposes two novel algorithms to estimate the moisture ratio model of a cantaloupe drying process.
The steps of population iterative evolution algorithms are similar to biological evolution processes, and the goal of population iterative evolution algorithms is to generate an individual who has the best adaptability to the environment [24,25]. Specifically, the population iterative evolution algorithms are iterative processes in which the individuals evolve as the increase of generation from a randomly selected initial population [26,27]. The differential evolution algorithm is one of the population iterative evolution algorithms. It is easy to realize and performs well in finding the best solutions to complex optimization problems [28,29]. There are three main steps of the differential evolution algorithm, including the mutation process, the crossover process, and the selection process [30]. Recently, by using the differential evolution algorithm and designing a specific mutation strategy, Stanovov et al. developed a dual-population algorithmic scheme [31]. Combining the differential evolution algorithm and the extended Kalman filter, Xiao et al. presented a joint algorithm for the state of charge estimation [32]. This paper took the maximum likelihood fitness in the differential evolution algorithm and thus derived two novel algorithms for model estimation.
The main contributions of this paper are listed as follows. 1.
An image processing-based cantaloupe drying system was designed to generate the experimental data and the expression of the moisture ratio with regard to the shrinkage in the drying process of cantaloupe slices was built in line with the Weierstrass approximation theorem.

2.
Through deducing the maximum likelihood fitness, a maximum likelihood principlebased iterative evolution (MLP-IE) algorithm was developed to estimate the moisture ratio model.

3.
Aiming at enhancing the model fitting ability of the MLP-IE algorithm, a maximum likelihood principle-based improved iterative evolution (MLP-I-IE) algorithm was proposed by designing the improved mutation strategy, the improved scaling factor, and the improved crossover rate.

4.
The MLP-IE algorithm and MLP-I-IE algorithm were applied for estimating the moisture ratio model of cantaloupe slices. The results showed that both the two proposed algorithms were effective and that the MLP-I-IE algorithm performed better than the MLP-IE algorithm in model estimation and validation.

Design of Cantaloupe Microwave Drying System Based on Image Processing
In recent years, image processing has been widely used in a variety of drying systems [33,34]. By constructing the expression between the visual appearances such as the color, size, and shape, and the easily measured quality attributes such as the moisture content, density, and porosity at different stages of drying processes, image processing has been used to evaluate the qualities of dried products at a specific time in drying processes [35,36].
The fresh cantaloupes used in the experiments were purchased at a local market in Wuxi, China. Undamaged cantaloupes were selected and stored at 5°C and then placed at room temperature at 20°C for 30 min before drying. They were washed, peeled, and cut into 6 mm slices using a mechanical cutter. The slices were then cut into 25 mm diameter cylindrical pieces with a cutting tool. The initial moisture content of fresh cantaloupe samples was measured as 9.87 g/g on the dry basis by drying with hot air at 105°C for 24 h, which was adequate to obtain the constant mass of the slices. The developed experiment system consisted of an image processing unit and a microwave drying unit. In the image processing part, 3 LED light strips were applied as light sources, which were installed on the door of the microwave oven. A hole with a diameter of 6 mm was drilled in the top of the microwave oven for imaging, and an industrial camera (SKT-SL1200C-123A, Chengyishun Tech. Co. Ltd., Shenzhen, China) was installed above the hole. The collected images were transmitted to the PC via a USB cable. As for the microwave drying part, a 700 W microwave oven (EM7KCGW3-NR, Midea Co. Ltd., Guangzhou, China) was utilized for drying, where the original circuit was modified to make the microwave power continuously adjustable with the help of a Triac and a data acquisition (DAQ) board (USB 6008, National Instruments Corp., Austin, TX, USA). The sample holding plate was supported by an electric balance above the microwave oven cavity through four Teflon sticks for mass measurement. The electronic scale was able to read the mass information in real time and transfer the data to the PC through the RS232 to USB cable. The precision of the electronic balance was 0.01 g. An optical fiber sensor (HQFTS-PAA0A-0300, Xian Heqi Photoelectric Tech. Co. Ltd., Xi'an, China) was inserted into the core of one of the samples to take temperature [37]. The collected optical signal representing the temperature was converted into a DC voltage signal through the temperature transmitter and was recognized by the PC via the DAQ module.
The drying scheme was microwave drying at a constant temperature of 60°C. The temperature of the material core was measured in real-time by the optical fiber, and the constant drying temperature of 60°C was achieved by continuously adjusting the power under a PID control strategy [38]. Mass was measured and the image processing algorithm was performed every 30 s, followed by data recording. Drying was stopped when the dry basis moisture content reached 0.176 g/g, that is, the sample mass detected by the electronic scale reached the corresponding converted mass.
An image processing algorithm was developed to monitor the shrinkage of the material. The software, Vision and Motion Module based on LabVIEW (Version 16.0; National Instruments Corp., Austin, TX, USA), was utilized to implement the algorithm. The procedure of the image processing is summarized in Figure 1, and a typical example of the steps is illustrated in Figure 2.

Moisture Ratio Model of Cantaloupe Slices
During the microwave-drying process, the moisture content M C (t) and the moisture ratio M R (t) of the cantaloupe samples were defined as where t is the drying time (min), m(t) is the real mass of the samples at time t (g), m d is the mass of dry matter of the samples (g), M C (t) is the moisture content at time t (g/g), M C (0) is the initial moisture content at time t = 0 (g/g), and M R (t) is the moisture ratio at time t (dimensionless). The shrinkage of the samples (i.e., the area ratio) was defined as where A(t) is the area at time t, which is expressed by the number of pixels of the samples (px), A(0) is the initial area of the samples (px), and S(t) is the shrinkage of the samples at time t (dimensionless). The moisture ratio M R (t) could be expressed as a function of the shrinkage S(t): where M R (t) is the experimental moisture ratio, S(t) is the shrinkage of the samples, f (S(t)) is the function value, and w(t) is a white Gaussian noise with variance σ 2 .
According to Theorem 1, it can be deduced that any continuous function f (x) can be approximated arbitrarily by a polynomial µ(x) with the required accuracy. Compared with other models, such as a linear model, a quadratic polynomial, an exponential model, and so on, the polynomial model can be applied more widely in describing or predicting the moisture ratio models of different materials under different drying conditions and processes. This is because the polynomial model can approximate any type of model as stated in Theorem 1. (Weierstrass approximation theorem). By replacing f (S(t)) in (1) with a n-order polynomial µ(S(t)), Equation (1) could be reritten as The parameter vector γ and the information vector τ(t) were defined as γ = [r 0 , r 1 , r 2 , · · · , r n ] T ∈ R Q , Q = n + 1, τ(t) = [1, S(t), S 2 (t), · · · , S n (t)] T ∈ R Q . Therefore, Equation (2) could be reritten as The goal of this paper is to propose two new algorithms to estimate the model in (3) from a batch of discrete experimental data {S(t k ), M R (t k ) : k = 1, 2, · · · , D}. In addition, in this paper, we utilized the uniform sampling method with the sampling period ∆. Thus the experimental data could be represented as {S(k∆), M R (k∆) : k = 1, 2, · · · , k max } or {S(k), M R (k) : k = 1, 2, · · · , k max } for short.

MLP-IE Algorithm
This section developed the maximum likelihood principle-based iterative evolution (MLP-IE) algorithm to estimate the parameter vector γ of the model in (3). There are five main stages of the MLP-IE algorithm, including the population initialization, the mutation stage, the crossover stage, the derivation of maximum likelihood fitness, and the selection stage.

Population Initialization
The MLP-IE algorithm started with the generation of an initial population. Considering the Q-dimensional parameter vector to be estimated γ in (3), the population size was supposed to be P ∈ R and the initial population was defined aŝ which contains P initial individuals (i.e., the parameter vectors to be estimated) fromγ 0 1 tô γ 0 P . In the initial populationΓ 0 , the pth initial individual waŝ where p is the index for the individuals. Each element in the pth initial individualγ 0 p was randomly generated as follows: where q is the index for the elements in the pth individual and rand(0, 1) is a uniformly distributed stochastic number between 0 and 1. Thus the population initialization was completed.
Because the population and the individuals were changed with the different evolution generations, we defined the populationΓ g and the individualγ g p at the generation g ∈ [0, g max − 1] asΓ Each individualγ g p in the populationΓ g is a possible estimate of the parameter vector γ.

Mutation Stage
After the population initialization, the mutation stage was realized to produce the mutant vector for each individualγ g p . The mutant vectorζ g p was defined aŝ At this stage, the mutant vectorζ g+1 p was produced by adding the vectorial difference between the second and the third individuals to the first individual: where F ∈ R is a positive constant called the scaling factor which controls the magnitude of the vectorial differenceγ g κ 2 −γ g κ 3 , and κ 1 , κ 2 , and κ 3 are integers stochastically selected from the set {1, 2, · · · , P} and those three integers κ 1 , κ 2 , and κ 3 are not equal to each other and not equal to the index p.

Crossover Stage
After producing the mutant vectorζ g+1 p during the mutation stage, the crossover stage was implemented to enhance population diversity. The crossover vectorη g p was defined aŝ In the crossover stage, some elements in the mutant vectorζ g+1 p and some elements in the individualγ g p were mixed to construct the crossover vectorη g+1 p . The scheme for generating every element in the crossover vectorη g+1 p was shown as follows: where C R ∈ R is a positive constant called the crossover rate which controls the probability of preserving elements in the mutant vectorζ g+1 p or the individualγ g p , and q rand , which is to ensure that the crossover vectorη g+1 p obtains at least one element in the mutant vector ζ g+1 p , is a integer stochastically selected from the set {1, 2, · · · , k max } and newly produced for each index p.

Selection Stage
At this stage, the fitness of the crossover vectorη g+1 p and the individualγ g p was assessed by calculating their MLFs λ(η g+1 p ) and λ(γ g p ) and the greedy selection strategy was adopted to determine whether the crossover vectorη g+1 p or the individualγ g p remained in the population. From (19), it could be seen that the smaller value of the MLF meant the better fitness. The selection stage was described by the following equations: According to (22), if the MLF of the crossover vectorη g+1 p is smaller, the individualγ g+1 p at the generation g + 1 will be taken the place of the crossover vectorη g+1 p ; otherwise, the individualγ g p will remain in the population until the generation g + 1.
Afterwards, we could find the best individualγ g+1 best at the generation g + 1 in the populationΓ g+1 = [γ g+1 1 ,γ g+1 2 , · · · ,γ g+1 P ] T through the following equation: When g < g max − 1, let g increase by 1 and repeat the mutation stage, the crossover stage, and the selection stage to update the individualγ g+1 p in the populationΓ g+1 . When g = g max − 1, the best individualγ g max best is the final estimate of the parameter vector γ. Combining (4)- (12) and (20)-(23), we have the MLP-IE algorithm to estimate the parameter vector γ of the model in (3): η g+1 p,q = ζ g+1 p,q , if rand(0, 1) < C R or q = q rand γ g p,q , if rand(0, 1) C R and q = q rand , The flowchart of utilizing the MLP-IE algorithm in (24)- (36) to estimate the parameter vector γ of the model in (3) is displayed in Figure 3.      ? Yes Is g < g max − 1 ?

Algorithm 1:
The pseudo codes of the MLP-IE algorithm 1 Data collection: Collect the discrete experimental data {S(1), S(2), · · · , S(k max )} and {M R (1), M R (2), · · · , M R (k max )}. 2 Initialization: Set the population size P, the scaling factor F, the crossover rate C R , and the maximum generation g max .

MLP-I-IE Algorithm
To enhance the model fitting ability of the MLP-IE algorithm, this section proposed the maximum likelihood principle-based improved iterative evolution (MLP-I-IE) algorithm by utilizing the improved mutation strategy, the improved scaling factor and the improved crossover rate.

Improved Mutation Strategy
From the mutation stage in (10), it could be seen that the three individualsγ g κ 1 ,γ g κ 2 , andγ g κ 3 were stochastically selected from the populationΓ g . In order to enhance the performance of the MLP-IE algorithm, we proposed an improved mutation strategy. In the improved mutation strategy, the three stochastically selected individualsγ It could be seen from (37) that the improved mutation strategy was no longer random search, but the base vectorγ g κ best searched in the direction ofγ g κ sub −γ g κ worst . It was worth noting that κ 1 , κ 2 , and κ 3 stochastically selected from the set {1, 2, · · · , P} were still not equal to each other and not equal to the index p and κ best , κ sub , and κ worst were chosen from {κ 1 , κ 2 , κ 3 }.

Improved Scaling Factor
Additionally, it could be observed from (10) that the scaling factor F controlled the magnitude of the vectorial differenceγ g κ 2 −γ g κ 3 . Thus we proposed an improved scaling factor F g+1 that was changed with the generation g + 1 to improve the performance of the MLP-IE algorithm: where f 1 , f 2 , and f 3 are positive constants. From the improved mutation strategy in (37) and the improved scaling factor F g+1 in (38), we could see that for the small generation g + 1, F g+1 was large enough to extend the range of the MLP-I-IE algorithm to search the optimal solution and as the generation g + 1 increased, F g+1 gradually decreased to accelerate the convergence speed. Compared with the scaling factor F in the MLP-IE algorithm, the improved scaling factor F g+1 took into account both the global search ability and the convergence speed.

Improved Crossover Rate
From the crossover stage in (12), we knew that the crossover rate C R determined that the element in the crossover vectorη or the element in the individualγ g p . Therefore, we proposed an improved crossover rate C g+1 R to enhance the performance of the MLP-IE algorithm: where c 1 and c 2 are positive constants. The improved crossover rate C g+1 R in (39) changed versus the generation g + 1 and updated once as the generation g + 1 changed twice. As the improved crossover rate C g+1 R constantly changed,η g+1 p,q preservedζ g+1 p,q orγ g p,q stochastically, which helped the MLP-I-IE algorithm jump from the local optimal solution. From the crossover stage in (11) and the improved crossover rate C g+1 R in (39), we could see that for the small crossover rate C g+1 R , the probability of keepingζ g+1 p,q inη g+1 p,q was large while for the large crossover rate C g+1 R , the probability of keepingγ g p,q inη g+1 p,q was large.
Combining the MLP-IE algorithm in (4)- (11) and (20)- (23), the improved mutation strategy in (37), the improved scaling factor in (38) and the improved crossover rate in (39), we have the MLP-I-IE algorithm to estimate the parameter vector γ of the model in (3): The flowchart of utilizing the MLP-I-IE algorithm in (40)-(54) to estimate the parameter vector γ of the model in (3) is displayed in Figure 4.

Algorithm 2:
The pseudo codes of the MLP-I-IE algorithm 1 Data collection: Collect the discrete experimental data {S(1), S(2), · · · , S(k max )} and {M R (1), M R (2), · · · , M R (k max )}. 2 Initialization: Set the population size P, the scaling factor F, the crossover rate C R , and the maximum generation g max .

Model Estimation
In model estimation, a batch of discrete experimental data {S(k), M R (k) : k = 1, 2, · · · , k max } during the drying process of cantaloupe slices sampled by the developed image processingbased microwave drying system were used. The orders n = 1, n = 2, and n = 3 were set for the model in (3), and the MLP-IE algorithm and MLP-I-IE algorithm (the population size P = 30 and the maximum generation g max = 20) were exploited to produce the parameter estimates. To evaluate the model fitting ability of the MLP-IE algorithm and MLP-I-IE algorithm and choose the optimal order, the fitting coefficient was defined as where M R,est (k) is the estimated moisture ratio, M R (k) is the experimental moisture ratio and M R is the average value of the experimental moisture ratios. Nevertheless, the model orders also affect the value of R 2 . If the model orders are different, R 2 cannot be used to evaluate the model fitting ability. The adjusted fitting coefficient adjR 2 was defined as which considers both the number of discrete experimental data k max and the number of parameters to be estimated n + 1. Moreover, the root-mean-square error (RMSE) was also used to evaluate the model fitting ability and it was defined as The parameter estimates given by the MLP-IE algorithm and MLP-I-IE algorithm for n = 1, n = 2, and n = 3 are summarized in Table 1. Besides, the values of R 2 , adjR 2 , and RMSE given by the MLP-IE algorithm and MLP-I-IE algorithm for n = 1, n = 2, and n = 3 are also shown in Table 1 and Figure 5. The curves of the estimated moisture ratio M R,est (k) and the experimental moisture ratio M R (k) versus the shrinkage S(k) for n = 1, n = 2, and n = 3 are depicted in Figures 6-8.  The improved scaling factor F g+1 and the improved crossover rate C g+1 R of the MLP-I-IE algorithm versus the generation g + 1 for n = 3 are illustrated in Figure 9.

Model Validation
In model validation, another batch of discrete experimental data {S(k), M R (k) : k = 1, 2, · · · , k max } during the drying process of cantaloupe slices sampled by the developed image processing-based microwave drying system were used. The parameter estimatesγ given by the MLP-IE algorithm and MLP-I-IE algorithm for n = 3 were used to compute the predicted moisture ratio M R,pre (k). The fitting coefficient R 2 of the predicted model was computed by the adjusted fitting coefficient adjR 2 of the predicted model was computed by , and the RMSE of the predicted model was computed by The values of R 2 , adjR 2 , and RMSE given by the MLP-IE algorithm and the MLP-I-IE algorithm for the predicted model are shown in Table 2 and Figure 10. The curves of the predicted moisture ratio M R,pre (k) versus the shrinkage S(k) are illustrated in Figures 11. The comparisons of the predicted moisture ratio M R,pre (k) and the experimental moisture ratio M R (k) are illustrated in Figures 12.  Figure 10. The values of R 2 , adjR 2 , and RMSEs of the estimated models given by different algorithms for different orders n. The following conclusions were deduced in accordance with the results in Tables 1 and 2  and Figures 5-12. It could be deduced from Table 1 and Figures 5-9 that both the MLP-IE algorithm and MLP-I-IE algorithm were effective for model fitting because the estimated moisture ratios M R,est (k) given by the two algorithms were close to the experimental moisture ratio M R (k). For the same order, the adjusted fitting coefficient adjR 2 of the estimated model given by the MLP-I-IE algorithm was larger than that given by the MLP-IE algorithm, and the RMSE of the estimated model given by the MLP-I-IE algorithm was smaller than that given by the MLP-IE algorithm, which meant the MLP-I-IE algorithm performed better than the MLP-IE algorithm in model fitting. Meanwhile, n = 3 was selected as the optimal order for the reason that the adjusted fitting coefficients adjR 2 of the estimated models given by the MLP-IE algorithm and the MLP-I-IE algorithm for n = 3 were larger than adjR 2 for n = 1 and n = 2, and the RMSEs of the estimated models given by the MLP-IE algorithm and the MLP-I-IE algorithm for n = 3 were smaller than RMSEs for n = 1 and n = 2.
It could be seen from Table 2 and Figures 10-12 that the predicted model given by the MLP-I-IE algorithm had the larger adjR 2 and the smaller RMSE than that given by the MLP-IE algorithm, indicating that the predicted model given by the MLP-I-IE algorithm was better than that given by the MLP-IE algorithm. In other words, the predicted moisture ratio M R,pre (k) given by the MLP-I-IE algorithm was closer to the MLP-IE algorithm. Therefore, the proposed MLP-I-IE algorithm had more excellent performance in estimation and prediction and could be utilized to predict the moisture ratio model of the cantaloupe microwave drying process.

Conclusions
In this paper, an image processing-based cantaloupe drying system was designed to generate the experimental data and the mathematical model of the moisture ratio with regard to the shrinkage during the drying process of cantaloupe slices was built according to Weierstrass approximation theorem. By deriving the maximum likelihood fitness, the MLP-IE algorithm was developed to estimate the moisture ratio model. Afterwards, by designing the improved mutation strategy, the improved scaling factor, and the improved crossover rate, we proposed the MLP-I-IE algorithm to strengthen the model fitting ability of the MLP-IE algorithm. Finally, the results revealed that the two presented algorithms were effective for model fitting, and that the MLP-I-IE algorithm was able to estimate a more accurate model than the MLP-IE algorithm. In our future work, we will study adjusted algorithms with better prediction effects and develop different control strategies to improve the quality of drying products during food microwave-drying processes.
Author Contributions: Conceptualization, G.Z., G.S.V.R. and Z.L.; methodology, G.Z., G.S.V.R. and Z.L.; modeling and data analysis, G.Z.; system design and experimental work, G.Z.; writingoriginal draft preparation, G.Z.; writing-review and editing, G.S.V.R. and Z.L.; supervision, G.S.V.R. and Z.L.; funding acquisition, G.Z. and Z.L.; All authors have read and agreed to the published version of the manuscript.